Top | ![]() |
![]() |
![]() |
![]() |
GDataCalendarCalendar * | gdata_calendar_calendar_new () |
void | gdata_calendar_calendar_get_color () |
void | gdata_calendar_calendar_set_color () |
gboolean | gdata_calendar_calendar_is_hidden () |
void | gdata_calendar_calendar_set_is_hidden () |
gboolean | gdata_calendar_calendar_is_selected () |
void | gdata_calendar_calendar_set_is_selected () |
const gchar * | gdata_calendar_calendar_get_timezone () |
void | gdata_calendar_calendar_set_timezone () |
const gchar * | gdata_calendar_calendar_get_access_level () |
char * | access-level | Read |
GDataColor * | color | Read / Write |
gboolean | is-hidden | Read / Write |
gboolean | is-selected | Read / Write |
char * | timezone | Read / Write |
GDataCalendarCalendar is a subclass of GDataEntry to represent a calendar from Google Calendar.
GDataCalendarCalendar implements GDataAccessHandler, meaning the access rules to it can be modified using that interface. As well as the
access roles defined for the base GDataAccessRule (e.g. GDATA_ACCESS_ROLE_NONE
), GDataCalendarCalendar has its own, such as
GDATA_CALENDAR_ACCESS_ROLE_EDITOR
and GDATA_CALENDAR_ACCESS_ROLE_FREE_BUSY
.
For more details of Google Calendar's GData API, see the online documentation.
Example 15. Listing Calendars
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
GDataCalendarService *service; GDataFeed *feed; GList *i; GError *error = NULL; /* Create a service */ service = create_calendar_service (); /* Query for all of the calendars the currently authenticated user has access to, including those which they have read-only * access to. */ feed = gdata_calendar_service_query_all_calendars (service, NULL, NULL, NULL, NULL, &error); g_object_unref (service); if (error != NULL) { g_error ("Error querying for calendars: %s", error->message); g_error_free (error); return; } /* Iterate through the returned calendars and do something with them */ for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) { const gchar *access_level; gboolean has_write_access; GDataCalendarCalendar *calendar = GDATA_CALENDAR_CALENDAR (i->data); /* Determine whether we have write access to the calendar, or just read-only or free/busy access. Note that the access levels * are more detailed than this; see the documentation for gdata_calendar_calendar_get_access_level() for more information. */ access_level = gdata_calendar_calendar_get_access_level (calendar); has_write_access = (access_level != NULL && strcmp (access_level, GDATA_CALENDAR_ACCESS_ROLE_EDITOR) == 0) ? TRUE : FALSE; /* Do something with the calendar here, such as insert it into a UI */ } g_object_unref (feed); |
GDataCalendarCalendar *
gdata_calendar_calendar_new (const gchar *id
);
Creates a new GDataCalendarCalendar with the given ID and default properties.
void gdata_calendar_calendar_get_color (GDataCalendarCalendar *self
,GDataColor *color
);
Gets the “color” property and puts it in color
.
void gdata_calendar_calendar_set_color (GDataCalendarCalendar *self
,const GDataColor *color
);
Sets the “color” property to color
.
gboolean
gdata_calendar_calendar_is_hidden (GDataCalendarCalendar *self
);
Gets the “is-hidden” property.
Since: 0.2.0
void gdata_calendar_calendar_set_is_hidden (GDataCalendarCalendar *self
,gboolean is_hidden
);
Sets the “is-hidden” property to is_hidden
.
Since: 0.2.0
gboolean
gdata_calendar_calendar_is_selected (GDataCalendarCalendar *self
);
Gets the “is-selected” property.
Since: 0.2.0
void gdata_calendar_calendar_set_is_selected (GDataCalendarCalendar *self
,gboolean is_selected
);
Sets the “is-selected” property to is_selected
.
Since: 0.2.0
const gchar *
gdata_calendar_calendar_get_timezone (GDataCalendarCalendar *self
);
Gets the “timezone” property.
void gdata_calendar_calendar_set_timezone (GDataCalendarCalendar *self
,const gchar *_timezone
);
Sets the “timezone” property to the new timezone, _timezone
.
Set _timezone
to NULL
to unset the property in the calendar.
const gchar *
gdata_calendar_calendar_get_access_level
(GDataCalendarCalendar *self
);
Gets the “access-level” property.
typedef struct _GDataCalendarCalendar GDataCalendarCalendar;
All the fields in the GDataCalendarCalendar structure are private and should never be accessed directly.
typedef struct { } GDataCalendarCalendarClass;
All the fields in the GDataCalendarCalendarClass structure are private and should never be accessed directly.
“access-level”
property “access-level” char *
Indicates the access level the current user has to the calendar. For example: GDATA_CALENDAR_ACCESS_ROLE_READ
or
GDATA_CALENDAR_ACCESS_ROLE_FREE_BUSY
. The "current user" is the one authenticated against the service's “authorizer”,
or the guest user.
Owner: GDataCalendarCalendar
Flags: Read
Default value: NULL
“color”
property“color” GDataColor *
The background color used to highlight the calendar in the user’s browser. This used to be restricted to a limited set of colours, but since 0.17.2 may be any RGB colour.
Owner: GDataCalendarCalendar
Flags: Read / Write
“is-hidden”
property “is-hidden” gboolean
Indicates whether the calendar is visible.
Owner: GDataCalendarCalendar
Flags: Read / Write
Default value: FALSE
Since: 0.2.0
“is-selected”
property “is-selected” gboolean
Indicates whether the calendar is selected.
Owner: GDataCalendarCalendar
Flags: Read / Write
Default value: FALSE
Since: 0.2.0
“timezone”
property “timezone” char *
The timezone in which the calendar's times are given. This is a timezone name in tz database notation: reference.
Owner: GDataCalendarCalendar
Flags: Read / Write
Default value: NULL